#绝对布局  窗口指定每一个控件显示的坐标和大小来布局的
import sys
from  PyQt5.QtWidgets import *
class Example(QWidget):
    def __init__(self,parent=None):
        super(Example,self).__init__(parent)
        self.initUI()
    def initUI(self):
        name=QLabel('姓名')
        sex=QLabel('性别')
        age=QLabel('年纪')
        nameEdit=QLineEdit()
        sexEdit = QLineEdit()
        ageEdit = QLineEdit()
        grid=QGridLayout()
        grid.addWidget(name,1,0)
        grid.addWidget(nameEdit,1,1)

        grid.addWidget(sex, 2, 0)
        grid.addWidget(sexEdit, 2, 1)

        grid.addWidget(age, 3, 0)
        grid.addWidget(ageEdit, 3, 1,33,44)


        self.setLayout(grid)
        self.setGeometry(400,400,450,450)
        self.setWindowTitle("网格")
if __name__ == '__main__':
    app=QApplication(sys.argv)
    demo=Example()
    demo.show()
    sys.exit(app.exec_())
